Integrand size = 29, antiderivative size = 193 \[ \int \frac {\cot ^2(c+d x) \csc ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx=-\frac {2 b^2 \left (3 a^2-4 b^2\right ) \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{a^5 \sqrt {a^2-b^2} d}-\frac {b \left (a^2-4 b^2\right ) \text {arctanh}(\cos (c+d x))}{a^5 d}+\frac {\left (a^2-12 b^2\right ) \cot (c+d x)}{3 a^4 d}+\frac {2 b \cot (c+d x) \csc (c+d x)}{a^3 d}-\frac {4 \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}+\frac {\cot (c+d x) \csc ^2(c+d x)}{a d (a+b \sin (c+d x))} \]
[Out]
Time = 0.73 (sec) , antiderivative size = 193, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.276, Rules used = {2968, 3135, 3134, 3080, 3855, 2739, 632, 210} \[ \int \frac {\cot ^2(c+d x) \csc ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx=\frac {2 b \cot (c+d x) \csc (c+d x)}{a^3 d}-\frac {4 \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}-\frac {2 b^2 \left (3 a^2-4 b^2\right ) \arctan \left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{a^5 d \sqrt {a^2-b^2}}-\frac {b \left (a^2-4 b^2\right ) \text {arctanh}(\cos (c+d x))}{a^5 d}+\frac {\left (a^2-12 b^2\right ) \cot (c+d x)}{3 a^4 d}+\frac {\cot (c+d x) \csc ^2(c+d x)}{a d (a+b \sin (c+d x))} \]
[In]
[Out]
Rule 210
Rule 632
Rule 2739
Rule 2968
Rule 3080
Rule 3134
Rule 3135
Rule 3855
Rubi steps \begin{align*} \text {integral}& = \int \frac {\csc ^4(c+d x) \left (1-\sin ^2(c+d x)\right )}{(a+b \sin (c+d x))^2} \, dx \\ & = \frac {\cot (c+d x) \csc ^2(c+d x)}{a d (a+b \sin (c+d x))}+\frac {\int \frac {\csc ^4(c+d x) \left (4 \left (a^2-b^2\right )-3 \left (a^2-b^2\right ) \sin ^2(c+d x)\right )}{a+b \sin (c+d x)} \, dx}{a \left (a^2-b^2\right )} \\ & = -\frac {4 \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}+\frac {\cot (c+d x) \csc ^2(c+d x)}{a d (a+b \sin (c+d x))}+\frac {\int \frac {\csc ^3(c+d x) \left (-12 b \left (a^2-b^2\right )-a \left (a^2-b^2\right ) \sin (c+d x)+8 b \left (a^2-b^2\right ) \sin ^2(c+d x)\right )}{a+b \sin (c+d x)} \, dx}{3 a^2 \left (a^2-b^2\right )} \\ & = \frac {2 b \cot (c+d x) \csc (c+d x)}{a^3 d}-\frac {4 \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}+\frac {\cot (c+d x) \csc ^2(c+d x)}{a d (a+b \sin (c+d x))}+\frac {\int \frac {\csc ^2(c+d x) \left (-2 \left (a^4-13 a^2 b^2+12 b^4\right )+4 a b \left (a^2-b^2\right ) \sin (c+d x)-12 b^2 \left (a^2-b^2\right ) \sin ^2(c+d x)\right )}{a+b \sin (c+d x)} \, dx}{6 a^3 \left (a^2-b^2\right )} \\ & = \frac {\left (a^2-12 b^2\right ) \cot (c+d x)}{3 a^4 d}+\frac {2 b \cot (c+d x) \csc (c+d x)}{a^3 d}-\frac {4 \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}+\frac {\cot (c+d x) \csc ^2(c+d x)}{a d (a+b \sin (c+d x))}+\frac {\int \frac {\csc (c+d x) \left (6 b \left (a^4-5 a^2 b^2+4 b^4\right )-12 a b^2 \left (a^2-b^2\right ) \sin (c+d x)\right )}{a+b \sin (c+d x)} \, dx}{6 a^4 \left (a^2-b^2\right )} \\ & = \frac {\left (a^2-12 b^2\right ) \cot (c+d x)}{3 a^4 d}+\frac {2 b \cot (c+d x) \csc (c+d x)}{a^3 d}-\frac {4 \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}+\frac {\cot (c+d x) \csc ^2(c+d x)}{a d (a+b \sin (c+d x))}+\frac {\left (b \left (a^2-4 b^2\right )\right ) \int \csc (c+d x) \, dx}{a^5}-\frac {\left (b^2 \left (3 a^2-4 b^2\right )\right ) \int \frac {1}{a+b \sin (c+d x)} \, dx}{a^5} \\ & = -\frac {b \left (a^2-4 b^2\right ) \text {arctanh}(\cos (c+d x))}{a^5 d}+\frac {\left (a^2-12 b^2\right ) \cot (c+d x)}{3 a^4 d}+\frac {2 b \cot (c+d x) \csc (c+d x)}{a^3 d}-\frac {4 \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}+\frac {\cot (c+d x) \csc ^2(c+d x)}{a d (a+b \sin (c+d x))}-\frac {\left (2 b^2 \left (3 a^2-4 b^2\right )\right ) \text {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a^5 d} \\ & = -\frac {b \left (a^2-4 b^2\right ) \text {arctanh}(\cos (c+d x))}{a^5 d}+\frac {\left (a^2-12 b^2\right ) \cot (c+d x)}{3 a^4 d}+\frac {2 b \cot (c+d x) \csc (c+d x)}{a^3 d}-\frac {4 \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}+\frac {\cot (c+d x) \csc ^2(c+d x)}{a d (a+b \sin (c+d x))}+\frac {\left (4 b^2 \left (3 a^2-4 b^2\right )\right ) \text {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a^5 d} \\ & = -\frac {2 b^2 \left (3 a^2-4 b^2\right ) \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{a^5 \sqrt {a^2-b^2} d}-\frac {b \left (a^2-4 b^2\right ) \text {arctanh}(\cos (c+d x))}{a^5 d}+\frac {\left (a^2-12 b^2\right ) \cot (c+d x)}{3 a^4 d}+\frac {2 b \cot (c+d x) \csc (c+d x)}{a^3 d}-\frac {4 \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}+\frac {\cot (c+d x) \csc ^2(c+d x)}{a d (a+b \sin (c+d x))} \\ \end{align*}
Time = 7.19 (sec) , antiderivative size = 385, normalized size of antiderivative = 1.99 \[ \int \frac {\cot ^2(c+d x) \csc ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx=-\frac {2 b^2 \left (3 a^2-4 b^2\right ) \arctan \left (\frac {\sec \left (\frac {1}{2} (c+d x)\right ) \left (b \cos \left (\frac {1}{2} (c+d x)\right )+a \sin \left (\frac {1}{2} (c+d x)\right )\right )}{\sqrt {a^2-b^2}}\right )}{a^5 \sqrt {a^2-b^2} d}+\frac {\left (a^2 \cos \left (\frac {1}{2} (c+d x)\right )-9 b^2 \cos \left (\frac {1}{2} (c+d x)\right )\right ) \csc \left (\frac {1}{2} (c+d x)\right )}{6 a^4 d}+\frac {b \csc ^2\left (\frac {1}{2} (c+d x)\right )}{4 a^3 d}-\frac {\cot \left (\frac {1}{2} (c+d x)\right ) \csc ^2\left (\frac {1}{2} (c+d x)\right )}{24 a^2 d}+\frac {\left (-a^2 b+4 b^3\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{a^5 d}+\frac {\left (a^2 b-4 b^3\right ) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{a^5 d}-\frac {b \sec ^2\left (\frac {1}{2} (c+d x)\right )}{4 a^3 d}+\frac {\sec \left (\frac {1}{2} (c+d x)\right ) \left (-a^2 \sin \left (\frac {1}{2} (c+d x)\right )+9 b^2 \sin \left (\frac {1}{2} (c+d x)\right )\right )}{6 a^4 d}-\frac {b^3 \cos (c+d x)}{a^4 d (a+b \sin (c+d x))}+\frac {\sec ^2\left (\frac {1}{2} (c+d x)\right ) \tan \left (\frac {1}{2} (c+d x)\right )}{24 a^2 d} \]
[In]
[Out]
Time = 0.78 (sec) , antiderivative size = 264, normalized size of antiderivative = 1.37
method | result | size |
derivativedivides | \(\frac {\frac {\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{2}}{3}-2 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b -\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a^{2}+12 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b^{2}}{8 a^{4}}-\frac {1}{24 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}-\frac {-a^{2}+12 b^{2}}{8 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {b}{4 a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\frac {b \left (a^{2}-4 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{5}}-\frac {2 b^{2} \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b^{2}+a b}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a}+\frac {\left (3 a^{2}-4 b^{2}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}}\right )}{a^{5}}}{d}\) | \(264\) |
default | \(\frac {\frac {\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{2}}{3}-2 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b -\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a^{2}+12 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b^{2}}{8 a^{4}}-\frac {1}{24 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}-\frac {-a^{2}+12 b^{2}}{8 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {b}{4 a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\frac {b \left (a^{2}-4 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{5}}-\frac {2 b^{2} \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b^{2}+a b}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a}+\frac {\left (3 a^{2}-4 b^{2}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}}\right )}{a^{5}}}{d}\) | \(264\) |
risch | \(-\frac {2 \left (6 a^{3} {\mathrm e}^{5 i \left (d x +c \right )}+12 i b^{3} {\mathrm e}^{6 i \left (d x +c \right )}+i a^{2} b -30 a \,b^{2} {\mathrm e}^{5 i \left (d x +c \right )}-12 i b^{3}+3 i a^{2} b \,{\mathrm e}^{4 i \left (d x +c \right )}+6 a \,b^{2} {\mathrm e}^{7 i \left (d x +c \right )}+42 a \,b^{2} {\mathrm e}^{3 i \left (d x +c \right )}-36 i b^{3} {\mathrm e}^{4 i \left (d x +c \right )}+2 a^{3} {\mathrm e}^{i \left (d x +c \right )}+3 i a^{2} b \,{\mathrm e}^{6 i \left (d x +c \right )}+36 i b^{3} {\mathrm e}^{2 i \left (d x +c \right )}-18 a \,b^{2} {\mathrm e}^{i \left (d x +c \right )}-7 i a^{2} b \,{\mathrm e}^{2 i \left (d x +c \right )}\right )}{3 \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3} \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}-b +2 i a \,{\mathrm e}^{i \left (d x +c \right )}\right ) a^{4} d}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{a^{3} d}+\frac {4 b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{a^{5} d}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{a^{3} d}-\frac {4 b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{a^{5} d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \sqrt {-a^{2}+b^{2}}\, a +a^{2}-b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right ) b^{2}}{\sqrt {-a^{2}+b^{2}}\, d \,a^{3}}+\frac {4 b^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \sqrt {-a^{2}+b^{2}}\, a +a^{2}-b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, d \,a^{5}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \sqrt {-a^{2}+b^{2}}\, a -a^{2}+b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right ) b^{2}}{\sqrt {-a^{2}+b^{2}}\, d \,a^{3}}-\frac {4 b^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \sqrt {-a^{2}+b^{2}}\, a -a^{2}+b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, d \,a^{5}}\) | \(623\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 694 vs. \(2 (184) = 368\).
Time = 0.44 (sec) , antiderivative size = 1471, normalized size of antiderivative = 7.62 \[ \int \frac {\cot ^2(c+d x) \csc ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx=\text {Too large to display} \]
[In]
[Out]
\[ \int \frac {\cot ^2(c+d x) \csc ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx=\int \frac {\cos ^{2}{\left (c + d x \right )} \csc ^{4}{\left (c + d x \right )}}{\left (a + b \sin {\left (c + d x \right )}\right )^{2}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {\cot ^2(c+d x) \csc ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.34 (sec) , antiderivative size = 329, normalized size of antiderivative = 1.70 \[ \int \frac {\cot ^2(c+d x) \csc ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx=\frac {\frac {24 \, {\left (a^{2} b - 4 \, b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a^{5}} - \frac {48 \, {\left (3 \, a^{2} b^{2} - 4 \, b^{4}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{\sqrt {a^{2} - b^{2}} a^{5}} + \frac {a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 36 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{6}} - \frac {48 \, {\left (b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a b^{3}\right )}}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a\right )} a^{5}} - \frac {44 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 176 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 36 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 6 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{3}}{a^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{24 \, d} \]
[In]
[Out]
Time = 10.76 (sec) , antiderivative size = 1089, normalized size of antiderivative = 5.64 \[ \int \frac {\cot ^2(c+d x) \csc ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx=\text {Too large to display} \]
[In]
[Out]